# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=libretro-melonds
pkgver=2012
pkgrel=1
pkgdesc='Nintendo DS core'
arch=(loong64 x86_64)
url=https://github.com/libretro/melonDS
license=(GPL2)
groups=(libretro)
depends=(
  libgl
  libretro-core-info
)
makedepends=(
  git
  libglvnd
)
_commit=0e1f06da626cbe67215c3f06f6bdf510dd4e4649
source=(libretro-melonds::git+https://github.com/libretro/melonDS.git#commit=${_commit})
sha256sums=(SKIP)

pkgver() {
  cd libretro-melonds

  git rev-list --count HEAD
}

build() {
  export LDFLAGS="$LDFLAGS -lpthread"

  make -C libretro-melonds
}

package() {
  install -Dm 644 libretro-melonds/melonds_libretro.so -t "${pkgdir}"/usr/lib/libretro/
}

# vim: ts=2 sw=2 et:
